<?php if(!IS_AJAX){?>
<include file="Public:header" /><include file="Public:navgation" />
<!-- 信息提醒 -->

<!--<div class="alert alert-warning">
  <button class="close" data-dismiss="alert" type="button">×</button>
  通知：有新信息
  <div class="badge pull-right"> 2 </div>
</div>-->
<!-- 信息提醒结束 --> 


<div class="container-fluid main-content"> 
  <div class="page-title chart-container"> </div>
  <div class="row">
  
    <div class="col-md-3 col-sm-4">
        <if condition="!isMobile()">
            <div class="widget-container" style="margin:0;padding:0">
                <div class="heading">
                    <form role="form" method="post" action="{:U('Customer/index')}" class="checkoutform">
                        <div class="form-group">
                            <label for="email">搜索关键词</label>
                            <input class="form-control" id="keywords" name="keywords" value="{$keywords}" placeholder="关键字" type="text">
                        </div>
                        <hr>
                        <div class="form-group opacity">
                            <div class="panel">
                                <div class="panel-heading">
                                    <div class="panel-title">
                                        <a class="accordion-toggle collapsed" data-parent="#accordion" data-toggle="collapse" href="#faq1" style="font-size:14px">
                                            <div class="caret pull-right"></div>
                                            客户分类</a>
                                    </div>
                                </div>
                                <div class="panel-collapse collapse" id="faq1">
                                    <div class="panel-body" style="font-size: 14px;">
                                        <label class="radio" style=" margin-bottom:5px; margin-right:15px;"><input value="99999999" name="category" type="radio" nullmsg="" datatype="*" errormsg="" checked="checked"><span>全部</span></label>
                                        <volist name="candy" id="candy">
                                            <label class="radio" style=" margin-bottom:5px; "><input value="{$candy.id}" name="category" type="radio" nullmsg="" datatype="*" errormsg="" <eq name="status" value="0">checked="checked"</eq>><span>{$candy.name}</span></label>
                                        </volist>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <hr>
                        <div class="form-group">
                            <div class="col-md-12"  style="margin:0;padding:0">
                                <select class="form-control" name="pagesize" style="display:inline;width:50%;margin-right:15px;">
                                    <option value="10" <eq name="pagesize" value="10">selected="selected"</eq>>每页10条</option>
                                    <option value="25" <eq name="pagesize" value="25">selected="selected"</eq>>每页25条</option>
                                    <option value="50" <eq name="pagesize" value="50">selected="selected"</eq>>每页50条</option>
                                    <option value="100" <eq name="pagesize" value="100">selected="selected"</eq>>每页100条</option>
                                </select>
                                <button class="btn btn-sm btn-info pull-right" style="margin:0;padding:5px 15px;border-radius:0">点击搜索</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
            <else />
        </if>
    </div>
  

    <div class="col-md-9 col-sm-8">
      <div class="widget-container">
            <div class="heading hidden-xs"> 
                <i class="icon-bar-chart"></i> <span class="pagetitle">客户管理</span>
                <if condition="getAccessMenu($accessList, 'Intesys', 'Task', 'insert')&&!isMobile()"> 
                	<a class="pull-right" onClick="_openWindow('{:U('add')}',500, '新增客户信息', '提交',null,'')" href="#">添加</a> 
                </if>
            </div>
          <div class="DataListItembg " style="margin-top:4px; padding:0;">
              <a class="btn btn-info categorybtn listajaxrequest on"  style="margin-top:10px;border-radius:0" href="javascript:void(0);" rel="{:U('')}">全部</a>
              <volist name='holy' id='holy'>
                  <a class="btn btn-info categorybtn listajaxrequest" style="margin-top:10px;border-radius:0" href="javascript:void(0);" rel="{:U('',array('id'=>$holy['id']))}">{$holy.name}</a>
              </volist>
          </div>

<!-- 客户列表 -->
<div class="DataList CustomerList">
<?php }?>
  
  <!-- 数据主体 -->
  <volist name="list" id="vo">
    <div class="DataListItem DataListItembg item{$vo.id}" style="margin-top:4px; padding:0 5px;">

      <div class="row">
          <div class="col-sm-6 col-xs-12"><div class="widget-content padded"><h4 style="margin:0; font-size:16px; font-weight:bold; padding:5px 0;">{$vo.title} </h4>
        <p>联系人：{$vo.contacts}</p>
        <p>联系电话：{$vo.tel}</p> 
        <p>公司地址：{$vo.address}</p>
        
      <notempty name="vo['lastlog']">  
        <p>最新日志：{$vo.lastlog}</p>
      
      </notempty>
      </div></div>
          <div class="col-sm-6 col-xs-12 hidden-xs" style="text-align:right;">
          
          
          <div class="optionBtnBox"><a class="button deleteBtn" removeElement=".CustomerList .item{$vo.id}" href="javascript:void(0);" rel="{:U('delete', array('id' => $vo['id']))}"><i class="icon-trash"></i> 删除</a>　<a class="button" href="#window" onClick="_openWindow('{:U('edit', array('id' => $vo['id']))}', 500, '修改客户信息', '确认', null, '');"><i class="icon-edit"></i> 编辑</a>   
 
 
　
<a onClick="_openWindow('{:U('addlog', array('id' => $vo['id']))}', 500, '日志', '确认', null, '');" class="button" href="##" rel=""><i class="icon-file-text-alt"></i> 日志</a></div></div>
      </div>
      

      <div class="BottomOptionBtn hidden"><a class="button BottomdeleteBtn" removeElement=".CustomerList .item{$vo.id}" href="javascript:void(0);" rel="{:U('delete', array('id' => $vo['id']))}"><i class="icon-trash"></i>删除</a> <a class="button" href="#window" onClick="_openWindow('{:U('edit', array('id' => $vo['id']))}', 500, '修改客户信息', '保存', null, '');"><i class="icon-edit"></i> 编辑</a>   
 
 

<a onClick="_openWindow('{:U('addlog', array('id' => $vo['id']))}', 500, '日志', '确认', null, '');" class="button" href="##" rel=""><i class="icon-file-text-alt"></i>
日志</a>

</div>
      
    </div>
    
    <!-- 数据主体结束 --> 
    
  </volist>
  <?php if(!IS_AJAX){?>
</div>
<div class="loading hidden">正在加载</div>
<div class="PagesBox"><?php echo $pages;?></div> 
<!-- 客户列表结束 --> 


</div></div></div></div>


<script>
    $.cookie('loadIndexUrl', window.location.href, {path:'/'});
    $(".checkoutform:eq(0)").Validform({
        ajaxPost:true,
        tiptype:function(data,s){
            if(s.type == 1){
                //$.ThinkBox.success(data,{'delayClose':0, 'close': '关闭'});
            }
        },
        datatype:{
            "text":function(gets,obj,curform,regxp){
                return true;
            },"image":function(gets,obj,curform,regxp){
                return true;
            }
        },
        callback:function(data){
            //检测登录
            $('.ThinkBox-close').trigger('click');
            if(data.status == 0){
                //$.ThinkBox.error(data.info,{'delayClose':200});
                //$.ThinkBox('hide');

                //$.ThinkBox.error(data.info,{'delayClose':200});
            }else{
                //alert(data.info);
                //alert(id);

                //更新列表
                updateList();

            }
        }
    });

    function mission_send(id,e){
        if(!confirm('确定递交吗？')){
            return false;
        }
        hideLayer();
        $.post('{:U('send')}', {id:id}, function(data){
            if(data.status == 1){
                updateList();
            }else{
                alert(data.info);
            }
        }, 'json');
    }



    function mission_cancel(id,e){
        if(!confirm('确定取消吗？')){
            return false;
        }
        hideLayer();
        $.post('{:U('cancel')}', {id:id}, function(data){
            if(data.status == 1){
                updateList();
            }else{
                alert(data.info);
            }
        }, 'json');
    }

</script>
<include file="Public:footer" />
<?php }?>
